home *** CD-ROM | disk | FTP | other *** search
/ Inside Mac Games Volume 7 #7 / IMG Vol 7-7.iso / Updates / X-System 5.12 Mini / World-Maker Instructions.txt < prev    next >
Text File  |  1999-09-27  |  17KB  |  310 lines

  1. ===============================================================================
  2. ===GENERAL INSTRUCTIONS========================================================
  3. ===============================================================================
  4.  
  5. X-Plane comes with scenery files for the United States (including Alaska and Hawaii), Canada, Europe, Japan, and Australia. Most of the rest of the world can be downloaded free from www.x-plane.com.
  6.  
  7. This scenery (terrain elevation and obstacle) data was obtained by an adaptive-gridding program that pulled in data from numerous different sources. The advantage is that it allows scenery for the entire planet, the disadvantage is that it does not 'hand-craft' each file, so some errors concerning lakes and rivers (and buildings that the F.A.A. does not consider to be obstacles to navigation) can occurr.
  8.  
  9. As a result, World-Maker was introduced to allow custom hand-crafting of the X-Plane world. You can use World-Maker to improve the existing terrain files provided on your CD or at www.x-plane.com.
  10.  
  11. It is NOT recommended that you use World-Maker to start from scratch.. instead you should use it to modify EXISTING scenery. If you want to modify scenery, you need to start by copying the scenery files from the X-Plane CD to you hard drive (where they can be edited), or by downloading them from www.x-plane.com.
  12.  
  13. If you wish to edit an area of the world for which no scenery files are currently available (such as Russia and Africa) email austin@x-plane.com and give the exact latitude and longitude that you wish to edit, and he will provide that region for you.
  14.  
  15.  
  16.  
  17. Look on your X-Plane CD, in the DATA folder.
  18.  
  19. Notice that all the folders on the CD have names like "+020-120". Each of these folders contains up to 100 "env" files. Open up a folder to see the "env" files inside of it. A file with the name "+024-081.env" contains elevation and obstacle data (scenery) for ONE SQUARE DEGREE OF LATITUDE AND LONGITUDE, WHOSE SOUTH-WEST CORNER IS AT A LATITUDE OF 24 DEGREES AND LONGITUDE OF -81 DEGREES.
  20.  
  21. Each folder contains all the "env" files for a region that is 10 degrees in latitude by 10 degrees in longitude, and the name of the folder is the latitude and longitude of the SOUTH-WEST CORNER of that 10 degree by 10 degree region.
  22.  
  23. Say you want to edit a scenery file to put in your own obstacles, change the terrain, or put in or modify airports.
  24.  
  25. First, find the folder-full of "env" files that contains the area that you want to edit. If the folder containing the area that you want to edit is not on the X-Plane CD (which has USA, Europe, and Australia) then try the scenery download section of x-plane.com. Copy that folder (complete with all the "env" files inside of it) to your "additonal nav data" folder in your main X-System folder.
  26.  
  27. Once you have the folder-full of "env" files in your "additonal nav data" folder, World-maker will be able to edit them, and X-Plane will use them.
  28.  
  29. Now, launch World-Maker and switch to the latitude and longitude of the file you wish to edit. The map that you see on the screen is the map read in FROM THE FILE IN THE "additional nav data" FOLDER! We never mess with the files on the CD, because they are read-only. Any changes that you make will affect the file in the "additional nav data" folder. Wherever you DON'T see any scenery other than water, there are simply no scenery files for that latitude and longitude in the "additional nav data" folder. When you launch X-Plane, X-Plane will check for files in the "additional nav data" folder BEFORE it checks for them on the CD, so any changes you make (and save) will take precedence over the scenery files that stay on the CD.... in other words, copy any files you like from the CD to the "additional nav data" folder and X-Plane will read them from that folder instead of the CD... and you can modify them with World-Maker.
  30.  
  31. Using World-Maker is intuitive, and you can easily experiment yourself to become proficient... hit the SPACE BAR when editing terrain to switch to "textured mode" and back to see how the terain textures will look when the scenery is used by X-Plane.
  32.  
  33. If you like, download the large "coastlines.zip" file from www.x-plane.com and extract it into your "additional nav data" folder... this will cause World-Maker to plot actual coastlines for the entire planet in World-Maker, thus allowing you to easily and rapidly perfect the coastlines in your scenery.
  34.  
  35. Realize that only data in the "additional nav data" folder is modified when you use World-Maker, and if you mess stuff up, all you have to do is copy the original files from the CD into the "additional nav data" folder or throw away the folder-fulls of "env" files from your "additional nav data" folder and you will be right back to where you started when you installed X-Plane.
  36.  
  37. Changes using the "Map" or "Obstacles" sections of World-Maker will effect the scenery files in the "additional nav data" folder. Whenever you add a standard building, you enter only the height and location... if the building is fairly small, then X-Plane will plot the building as a basic little 'block' with some flashing lights on it. If the building is large, then X-Plane will put window lights all over it, and put a helipad on the top for rapid access to corporate meetings.
  38.  
  39. You can add custom objects by creating them with a word-processing program. The file format for custom objects appears later in this document. Be sure to save the custom objects that you create with a word processor in the "custom objects" folder inside the "additional nav data" folder. To get at them in World-Maker, click on the object name box when in object editing mode in World-Maker.
  40.  
  41. You can also add custom terrain textures. To do this, create bitmaps with a graphics program and be sure that the dimensions are powers of 2 (like 128 by 128 or 256 by 256) and the the textures are SQUARE (the bitmap must be as wide as it is tall). Save the bitmaps in the "custom terrain textures" folder inside the "additional nav data" folder. To get at them in World-Maker, click on the texture name box when in terrain editing mode in World-Maker.
  42.  
  43.  
  44. Changes to the "Airports" or "Navaids" sections of World-Maker will effect the airport and Navaid files in the "additional nav data" folder (with names "apt.dat" and "nav.dat").
  45.  
  46. ===============================================================================
  47. ===MAKING CUSTOM OBJECTS=======================================================
  48. ===============================================================================
  49.  
  50. You can make the Golden Gate Bridge, the Sears Tower, the Statue of Liberty, the Mirage and GM of Las Vegas, and any other buildings you like for X-Plane.. here's how:
  51.  
  52. =>Look in your ADDITIONAL NAV DATA folder.
  53.  
  54. =>Now look in your CUSTOM OBJECTS folder.
  55.  
  56. =>Open the file "building1.OBJ" with any word processor... this is a custom building. (IBM users can open with WordPad... you may have to mess with the carriage return to make the carriage returns come out right).
  57.  
  58. Anyway, here is the file format that you can use to make your own custom objects, including statues, bridges, custom buildings, your house, or anything else.. the sky is the limit.
  59.  
  60.  
  61. A
  62.  
  63. The file must start with a capital 'A' or 'I' (created on Apple or IBM) FOLLOWED IMMEDIATELY BY A CARRIAGE RETURN WITH NOT OTHER COMMENTS.
  64.  
  65.  
  66. 4 concrete            // east base
  67.  
  68. The number "4" means that you are about to give a polygon (4 corners).
  69. You may use "3" for a triangle, "2" for a line, or "1" for a point. (light)
  70. THERE MUST BE A COMMENT AFTER THE TEXTURE NAME! THE COMMENT MAY BE ANYTHING YOU LIKE, BUT A COMMENT IS REQUIRED!
  71.  
  72. The word "concrete" indicates the texture that this polygon will use... it may be any texture that you create... simply make a 24-bit BITMAP of anything you like and make sure it's dimensions are a power of 2 and save that texture in your 'objects' folder... that texture will then be available for your buildings... there is basically no limit to the number of textures and objects you create. Make your textures in any graphics program that can save bitmaps.
  73.  
  74.  
  75.  10  10  -10
  76.  15   0  -15
  77.  15   0   15
  78.  10  10   10
  79.  
  80. These are the points that define the polygon, X, Y, Z for each corner.
  81. X is positive meters EAST.
  82. Y is positive meters UP.
  83. Z is positive meters SOUTH.
  84. Define points clockwise starting from the upper-left corner for your 4-sided polygon.
  85.  
  86.  
  87. Make up to about 30 polygons or so, and then we get to LINES (good for antennas):
  88.  
  89.  
  90. 2  5 5 5            // antenna on roof
  91. -10  50  -10
  92. -10  70  -10
  93.  
  94.  
  95. The "2" means we have a line... Lines do not have textures... instead they have colors... the 5 5 5 are the red green and blue values of the lines ON A SCALE FROM 0 TO 10, WHERE 0 IS TOTALLY DARK, 10 IS FULL INTENSITY.
  96.  
  97.  
  98. 1  10 10 10            // light on antenna
  99. -9  55  -9
  100.  
  101.  
  102. Here is a light... the "1" means we have a point (light) and the 10 10 10 mean it gets a full red, green, and bue... it is a white light.
  103. Note: If you set your light color to 99 99 99 you will get a PULSING light.
  104.  
  105.  
  106. 99            // ALL OBJECTS MUST END WITH A 99 TO DENOTE THE END OF THE FILE!
  107.  
  108. You have to put a 99 at the end.
  109.  
  110.  
  111.  
  112.  
  113.  
  114. OK, that is how you make buildings.
  115.  
  116. To put them into X-Plane's world, go into world maker and add them as custom obstacles.
  117.  
  118. Here is how:
  119.  
  120. =>Launch World-Maker.
  121. =>Go to an area where you like to fly.
  122. =>Select OBSTACLE mode from the EDIT menu.
  123. =>Select ADD CUSTOM from the list on the right hand side of the screen and simply click on the map to place the custom object.
  124. =>Backspace over the '?' in the CHANGE NAME field and type in the name of the custom object you want to place there... say "BUILDING1" (not BUILDING1.OBJ... there is no need to type in the ".OBJ") to place the building that we just looked at.
  125.  
  126.  
  127. Now go into X-Plane, go to the airport that you just placed the building near, and look at it.
  128.  
  129.  
  130. OK, you got it... it is ludicrously easy...  NOW GO MAKE STUFF!
  131.  
  132.  
  133. ===============================================================================
  134. ===THE ENV FILE FORMAT=========================================================
  135. ===============================================================================
  136.  
  137. Supplementary note:
  138.  
  139. If you wish to generate your own ".env" files rather than use World-Maker, that is fine, but you must be a programmer to write a program to do the job.
  140.  
  141. The env files are in binary form, with byte order being native to the machine the file is being generated on. (Either Mac (MSBF) or IBM (LSBF)).
  142.  
  143. Start off with:
  144.  
  145. =>The character 'a' or 'i', depending on whether you are generating the file on an Apple or an IBM.
  146. =>The long integer '4', which indicates the format version.
  147.  
  148. Then, we output the lat, lon, and elevation for each point in the square degree of lat and lon that the file defines. The points start at the lower-left hand corner of the square degree of lat/lon, and work from left to right and then go up a row towards the top, etc.
  149.  
  150. Here is the source code from World-Maker that outputs the data:
  151.  
  152.       #define gnd_sect_i_DIM       59
  153.       #define gnd_sect_j_DIM       79
  154.  
  155.       for(j=0;j<=gnd_sect_j_DIM;j++)
  156.       for(i=0;i<=gnd_sect_i_DIM;i++)
  157.       {
  158.          xint code=(((is_water[i][j]                                    )?100000:0)
  159.                   + ((planest [i][j][1][0][0]-planest[i][j][0][0][0]>0.5)? 40000:0)    // custom tex no rotation
  160.                   + ((planest [i][j][0][0][0]-planest[i][j][0][1][0]>0.5)? 30000:0)    // custom tex rotated CW  90
  161.                   + ((planest [i][j][0][0][0]-planest[i][j][1][0][0]>0.5)? 20000:0)    // custom tex rotated CW 180
  162.                   + ((planest [i][j][0][1][0]-planest[i][j][0][0][0]>0.5)? 10000:0)    // custom tex rotated CW 270
  163.                   + ((planetex[i][j])))*(-1);
  164.  
  165.          ouf.write((char*)&planelat[i][j],sizeof(xflt));
  166.          ouf.write((char*)&planelon[i][j],sizeof(xflt));
  167.          ouf.write((char*)&planey  [i][j],sizeof(xflt));
  168.          ouf.write((char*)&code          ,sizeof(xint));
  169.       }
  170.  
  171.  
  172. "XINT" is simply type int.
  173. The lat and lon are the latitude and longitude of each vertex in the grid, of course.
  174. "Planey" is the elevation of the vertex.
  175. "is_water" is obvious, and "planetex" is the custom texture number that this polygon uses, if any.
  176. This vertex is for the lower-left (south-west) corner of the polygon that uses the listed texture.
  177.  
  178.  
  179. After outputting all the lat and lon data-points, we list all the obstacles in the region, as follows:
  180.  
  181.       for(n=0;n<total_obsDIM;n++)
  182.       {
  183.          if(intrange(obj_type[n],obj_contower,obj_stacks)){
  184.             ouf.write((char*)&obj_type[n],sizeof(xint));
  185.             ouf.write((char*)&obj_lat [n],sizeof(xflt));
  186.             ouf.write((char*)&obj_lon [n],sizeof(xflt));
  187.             ouf.write((char*)&obj_hddz[n],sizeof(xflt));
  188.             ouf.write((char*)&zero       ,sizeof(xint));
  189.             ouf.write((char*)&zero       ,sizeof(xint));}
  190.  
  191.          if(obj_type[n]==obj_custom){
  192.             ouf.write((char*)&obj_type[n],sizeof(xint));
  193.             ouf.write((char*)&obj_lat [n],sizeof(xflt));
  194.             ouf.write((char*)&obj_lon [n],sizeof(xflt));
  195.             ouf.write((char*)&obj_hddz[n],sizeof(xflt));
  196.             ouf.write((char*)&obj_name[n],sizeof(xchr)*nameDIM);}
  197.       }
  198.  
  199.       int nn=99;
  200.       ouf.write((char*)&nn,sizeof(xint));
  201.  
  202.       for(n=0;n<100;n++)    // output custom textures
  203.          ouf.write((char*)msc.texname[n],sizeof(xchr)*nameDIM);
  204.  
  205. where:
  206.  
  207. type is the type of obstacle,
  208.  
  209. building            = 2,
  210. radio tower            = 3,
  211. power-line tower    = 4,
  212. cooling tower        = 5,
  213. smoke stacks        = 6
  214.  
  215. lat and lon are the lat and lon of the obstacle, dz is the height of the obstacle, and i and j are the horizontal and vertical data point indices of the lower-left-hand corner of the quadrilateral that the obstacle falls on.
  216.  
  217. then, make sure to put a long set to '99' at the end... this is needed to tell x-plane to stop lookig for obstacle in the file. You must do this or X-Plane will hang in an infinite loop looking for more obstacles! Remember, this is all done in binary file mode.
  218.  
  219. whew!
  220.  
  221.  
  222.  
  223.  
  224.  
  225. If you wish to generate your own "apt.dat" file rather than use World-Maker, the format is simply text.
  226.  
  227. Here is a copy of the first line of the new data file:
  228.  
  229.  
  230. I
  231. 500 version
  232. 1  3127 0 1 CZML 108 Mile Airport
  233. 10  51.735298 -121.333504 14 x 162   4877  75 1231231
  234.  
  235.  
  236.  
  237. Here is what that stuff means:
  238.  
  239. I                            file was created on an IBM (A for Apple)
  240. copyright
  241.  
  242. 1                            facility type, 1=airport
  243. 3127                        airport elevation, 
  244. 0 1                            control tower present, display standard buildings 
  245.  CZML 108 Mile Airport        airport ID, airport name
  246.  
  247. 10                            facility type, 10=runway
  248. 31.578384  -94.708733        lat and lon of the CENTER OF THE RUNWAY
  249. 15 x 154   3610  75 226226    rway number, heading, length, width, runway code.
  250.  
  251. NOTES:
  252.  
  253. 1: the airport ID must be FOUR CHARACTERS, EVEN IF THE LAST CHARACTER IS A SPACE, and THEN there must be another space before the airport name.
  254.  
  255. 2: If the runway number is 99, THEN THE SURFACE IN QUESTIONIS ACTUALLY A CUSTOM TAXIWAY! If you make any custom taxiways, then X-Plane will NOT draw any DEFAULT taxiways at that airport.. you must add them all. BE SURE THAT ALL CUSTOM TAXIWAYS AT A GIVEN AIRPORT COME AFTER ALL THE REAL RUNWAYS AT THAT AIRPORT. X-Plane needs this. It is also nice to list the runways in order of size (biggest first) so the plotting looks nicer in X-Plane.
  256.  
  257. 3: the runway code is as follows:
  258.  
  259. 1 digit for the surface type
  260. 1 digit for glideslope type for the runway
  261. 1 digit for runway lighting type for the runway
  262. 1 digit for approach lighting type for the runway
  263. 1 digit for glideslope type for the OTHER END OF the runway
  264. 1 digit for runway lighting type for the OTHER END OF therunway
  265. 1 digit for approach lighting type for the OTHER END OF the runway
  266.  
  267.  
  268. here are the meanings of the digits:
  269.  
  270. surface type:
  271.  
  272.    asphault =1,
  273.    concrecte=2,
  274.    grass    =3,
  275.    dirt     =4,
  276.    gravel   =5
  277.  
  278.  
  279. glideslope:
  280.  
  281.    lgt_gls_none=1,
  282.    lgt_gls_vasi=2,
  283.    lgt_gls_papi=3
  284.  
  285. runway lights... will include everything up to and including the number you specify:
  286.  
  287.    lgt_rwy_none=1,
  288.    lgt_rwy_mirl=2,
  289.    lgt_rwy_reil=3,
  290.    lgt_rwy_rcls=4,
  291.    lgt_rwy_tdzl=5
  292.    TAXIWAY lighting (blue-dege)=6 (use this for your custom taxiways)
  293.  
  294.  
  295. approach lights:
  296.  
  297.    lgt_app_none =1,
  298.    lgt_app_sals1=2,
  299.    lgt_app_sals2=3,
  300.    lgt_app_alsf1=4,
  301.    lgt_app_alsf2=5,
  302.    lgt_app_odals=6
  303.  
  304.  
  305. A similar approach can be taken with nav.dat. Open the file and you ought to be able to figure out the format since it is also simply text.
  306.  
  307.  
  308.  
  309. Further questions? Subscribe to the X-Plane tech mailing list as explained near the bottom of www.X-Plane.com... that is the tech gossip hotline for X-Plane and is very busy with tons of info... you can get any questions answered there that you want.
  310.